package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:18
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelServiceTemplateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelServiceTemplateDAO.Id);

        mappedDaoFields.put("templateName",
            com.ourteam.product.model.dao.IProductModelServiceTemplateDAO.TemplateName);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelServiceTemplateDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelServiceTemplateDAO.Remarks);
    }

    private com.ourteam.product.model.dao.ProductModelServiceTemplate productModelServiceTemplate;

    public ProductModelServiceTemplateBean() {
        super();

        this.productModelServiceTemplate = new com.ourteam.product.model.dao.ProductModelServiceTemplate();
    }

    public ProductModelServiceTemplateBean(
        com.ourteam.product.model.dao.ProductModelServiceTemplate productModelServiceTemplate) {
        super();

        this.productModelServiceTemplate = productModelServiceTemplate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelServiceTemplate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelServiceTemplate convertToProductModelServiceTemplate() {
        return this.productModelServiceTemplate;
    }

    public com.ourteam.product.model.dao.ProductModelServiceTemplate convertTo() {
        return this.productModelServiceTemplate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelServiceTemplate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelServiceTemplate.setId(id);
    }

    /**
     * Get templateName
     *
     * @return String
     */
    public String getTemplateName() {
        return (String) this.productModelServiceTemplate.getTemplateName();
    }

    /**
     * Set templateName
     *
     * @parameter String
     */
    public void setTemplateName(String templateName) {
        this.productModelServiceTemplate.setTemplateName(templateName);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelServiceTemplate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelServiceTemplate.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelServiceTemplate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelServiceTemplate.setRemarks(remarks);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelServiceTemplateBean) == false) {
            return false;
        } // end if

        ProductModelServiceTemplateBean other = (ProductModelServiceTemplateBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelServiceTemplate tempProductModelServiceTemplate =
            other.convertToProductModelServiceTemplate();

        if ((tempProductModelServiceTemplate == null) ||
                (this.productModelServiceTemplate == null)) {
            isEqual = false;
        } else if ((tempProductModelServiceTemplate == this.productModelServiceTemplate) ||
                tempProductModelServiceTemplate.equals(
                    this.productModelServiceTemplate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelServiceTemplateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelServiceTemplate[] aProductModelServiceTemplates) {
        return toArray(aProductModelServiceTemplates, null);
    }

    public static ProductModelServiceTemplateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelServiceTemplate[] aProductModelServiceTemplates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelServiceTemplates)) {
            return new ProductModelServiceTemplateBean[0];
        }

        int length = aProductModelServiceTemplates.length;

        ProductModelServiceTemplateBean[] beans = new ProductModelServiceTemplateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelServiceTemplateBean(aProductModelServiceTemplates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelServiceTemplates[i] });
            }
        }

        return beans;
    }
}
